package com.sprinboot_vue.blog_springboot.controller;

import com.sprinboot_vue.blog_springboot.entity.Blog_file;
import com.sprinboot_vue.blog_springboot.mapper.Blog_fileMapper;
import com.sprinboot_vue.blog_springboot.repository.Blog_fileRepository;
import com.sprinboot_vue.blog_springboot.result.Result;
import com.sprinboot_vue.blog_springboot.result.ResultInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Thomas
 * @version 1.0
 * @date 2021/11/23 11:18
 */
@RestController
@RequestMapping("/blog_file")
@Api(tags = "返回归档日志")
public class Blog_fileHandler {
    @Autowired
    private Blog_fileRepository blog_fileRepository;
    @Autowired
    private Blog_fileMapper blog_fileMapper;

    @GetMapping("/findAllBlog_bile")
    @ApiOperation("返回所有的归档日志")
    public Result findAllBlog_bile(){
        List<Blog_file> blog_files = blog_fileMapper.FindAllBlog_file();
        return Result.success().codeAndmessage(ResultInfo.SUCCESS).date("data",blog_files);
    }
}
